import request from './request'
import { useUserStore } from "../store/modules/user"
//获取工单策略SLA列表
export function getListSLA(data) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/work/sla/getList',
        method: 'post',
        headers: token,
        data
    })
}
//批量删除工单策略SLA
export function deleteSLA(data) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/work/sla/',
        method: 'DELETE',
        headers: token,
        data,
    })
}
//批量启用或禁用工单策略SLA
export function disableSLA(data, status) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/work/sla/disable?status=' + status,
        method: 'put',
        headers: token,
        data,
    })
}
//新增或修改SLA
export function SaveSLA(data) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/work/sla/save',
        method: 'post',
        headers: token,
        data,
    })
}
//根据工单策略SLA ID获取修改前的数据
export function getBeforeEditData(id) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/work/sla/getBeforeEditData/'+id,
        method: 'get',
        headers: token,
    })
}
//根据工单策略SLA ID获取详情
export function getDetail(id) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/work/sla/getDetail/'+id,
        method: 'get',
        headers: token,
    })
}

